import {RouteRecordRaw} from 'vue-router'

/**
 * @param meta{
 *     title,
 *     tabBar:'是否显示底部导航栏',
 *     stateBar:{
 *         show:'是否显示导航栏'，
 *         showBack:'导航栏是否显示返回按钮（show为false时无效）'，
 *         rightText:'导航栏右边的文字（show为false时无效）'，
 *     },
 * }
 */
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        component: import(/* webpackChunkName: "home" */ '../views/home/Home.vue'),
        name: 'home',
        meta: {
            title: '首页',
            tabBar: true,
            stateBar: {show: true, showBack: true, rightText: ''},
        },
    },
    {
        path: '/cart',
        component: import(/* webpackChunkName: "cart" */ '../views/cart/Cart.vue'),
        name: 'cart',
        meta: {
            title: '购物车',
            tabBar: true,
            stateBar: {show: true, showBack: true, rightText: ''},
        },
    },
    {
        path: '/profile',
        component: import(/* webpackChunkName: "profile" */ '../views/profile/Profile.vue'),
        name: 'profile',
        meta: {
            title: '我的',
            tabBar: true,
            stateBar: {show: true, showBack: true, rightText: ''},
        },
    },
]

export default routes